package cn.findviewbydream.evil.motowaiter.dto

import cn.findviewbydream.evil.main.entity.OrderEntity
import cn.findviewbydream.evil.main.entity.OrderItemEntity
import java.io.Serializable

/********************************************
 * 工程名：MOtoWaiter
 * 包名：cn.findviewbydream.evil.motowaiter.dto
 * 时间：17-1-18
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
class OrderBean : Serializable
{
    var order: OrderEntity? = null
    var itemList: List<OrderItemEntity>? = null

    constructor()
    constructor(order: OrderEntity?, itemList: List<OrderItemEntity>?)
    {
        this.order = order
        this.itemList = itemList
    }


    override fun toString(): String
    {
        return "OrderBean(order=$order, itemList=$itemList)"
    }

    override fun equals(other: Any?): Boolean
    {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as OrderBean

        if (order != other.order) return false

        return true
    }

    override fun hashCode(): Int
    {
        return order?.hashCode() ?: 0
    }
}